package com.lulufind.lulu.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.lulufind.lulu.model.User;
import com.lulufind.lulu.vo.CoterieUserInfoVO;
import com.lulufind.lulu.vo.DemandUserInfoVO;
import com.lulufind.lulu.vo.TrendsVO;
import com.lulufind.lulu.vo.UserBindInfoVO;
import com.lulufind.lulu.vo.UserInfoVO;

public interface UserMapper {
	
	public int save(User user);
	public int saveByThird(User user);
	public int update(User user);
	public int updateToken(@Param("userId")int userId, @Param("userToken")String userToken);
	public int updatePasswd(@Param("userId")int userId, @Param("userPasswd")String userPasswd);
	public int updatePasswdByPhone(@Param("userPhone")String userPhone, @Param("userPasswd")String userPasswd);
	public int updatePhone(@Param("userPhone")String userPhone, @Param("userId")Integer userId);
	public int updateUserAvatar(@Param("userAvatar")String userAvatar, @Param("userId")int userId);
	public String findToken(@Param("userId")int userId);
	public Integer findIdByPhone(@Param("userPhone")String userPhone);
	public String findNameByPhone(@Param("userPhone")String userPhone);
	public Integer checkIdAndToken(@Param("userId")int userId, @Param("userToken")String userToken);
	public Integer checkPhoneAndPasswd(@Param("userPhone")String userPhone, @Param("userPasswd")String userPasswd);
	public Integer checkId(@Param("userId")int userId);
	public Integer checkIdByPasswd(@Param("userPasswd")String userPasswd);
	public Integer checkIdByThird(@Param("userRegType")int userRegType, @Param("userThirdId")String userThirdId);
	public Integer checkUserCity(@Param("userId")int userId);
	public Integer checkUserSchool(@Param("userId")int userId);
	
	public UserBindInfoVO findUserBindInfo(@Param("userId")Integer userId);
	public List<UserInfoVO> findFriends(@Param("userId")Integer userId, @Param("start")Integer start, @Param("num")Integer num);
	public List<UserInfoVO> findHotUserInfo(@Param("start")int start, @Param("num")int num);
	public UserInfoVO findUserInfo(@Param("userId")int userId);
	public DemandUserInfoVO findUserDemandInfo(@Param("userId")int userId);
	
	public List<TrendsVO> findUserTrends(@Param("userId")int userId, @Param("followIds")List<Integer> followIds, @Param("start")int start, @Param("num")int num);
	
	public List<CoterieUserInfoVO> findHotCoterieUserInfo(@Param("start")int start, @Param("num")int num);
}
